package com.htfyun.factorytest.common;

import android.content.ComponentName;
import android.media.AudioManager;
import android.os.Environment;

import com.blankj.utilcode.util.VolumeUtils;
import com.htfyun.factorytest.config.EinkProperty;

import java.io.File;

public class Constants {
    public static final String EXTRA_LAUNCH_SCREEN = "android.intent.extra.LAUNCH_SCREEN";
    // 没有设置的默认值，默认 A 屏。
    public static final int EXTRA_LAUNCH_SCREEN_PANEL_NONE = 0;
    // activity 在 A 屏运行。
    public static final int EXTRA_LAUNCH_SCREEN_PANEL_A = 1;
    // activity 在 B 屏运行。
    public static final int EXTRA_LAUNCH_SCREEN_PANEL_B = 2;
    // activity 在 A/B 屏运行，即全屏运行。
    public static final int EXTRA_LAUNCH_SCREEN_PANEL_BOTH = 3;

    //重启老化失败次数阈值
    public static final int MAX_WIFI_FAILURES_ALLOWED = Integer.MAX_VALUE;
    //PCBA音量
    public static final int PCBA_VOLUME = VolumeUtils.getMaxVolume(AudioManager.STREAM_MUSIC) * 24 / 30;
    //老化音量
    public static final int AGING_VOLUME = VolumeUtils.getMaxVolume(AudioManager.STREAM_MUSIC) * 22 / 30;
    //电池容量门限值
    public static final int BATTERY_CAPACITY_THRESHOLD = 2500;
    //JYT103S 自动关机时间
    public static final String POWER_OFF_TIMEOUT = "poweroff_off_timeout";
    //R2 disable
    public static final ComponentName COMPONENT_OOBE = new ComponentName(
            "com.iflytek.ainote.launcher",
            "com.iflytek.ainote.ui.activity.GuideActivity");
    public static final String[] DISABLE_PACKAGE_NAMES = {"com.iflytek.ainote.launcher", "com.iflytek.ainote.appstore",
            "com.iflytek.ainote.translator", "com.iflytek.diy.anchor", "com.iflytek.firmwaredownload",
            "com.iflytek.flyeinkreader", "com.android.systemui", "cn.wps.moffice_eng"};

    //pm state
    public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0;
    public static final int COMPONENT_ENABLED_STATE_ENABLED = 1;
    public static final int COMPONENT_ENABLED_STATE_DISABLED = 2;
    public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3;

    //lock screen png
    public static final String STANDBY_PNG = "xsys.eink.standby";

    //Battery Temperature
    public static final int MAX_TEMPERATURE_BATTERY = 55;
    public static final int MIN_TEMPERATURE_BATTERY = 5;
    public static final int INVALID_TEMPERATURE = -100;
    //Motherboard Temperature
    public static final int MAX_TEMPERATURE_MOTHERBOARD = 35;
    public static final int MIN_TEMPERATURE_MOTHERBOARD = 15;
    public static final String TEMPERATURE_PATH = "/sys/class/pmu/temperature";

    //ForeLight
    public static final String COLD_OFF = "0";
    public static final String WARM_OFF = "1";
    public static final String COLD_MODE = "2";
    public static final String WARM_MODE = "3";

    //config
    public static final String SECTION_FUNCTION_TEST = "function_test";
    public static final String SECTION_FUNCTION_TEST_AGING = "function_test_aging";
    public static final String SECTION_AGING = "aging";
    public static final String SECTION_PCBA = "pcba";
    public static final String PASS = "Pass";

    //screen offset
    public static final String SCREEN_OFFSET = "xsys.eink.xoffset";
    //AgingTest
    public static final String PERSIST_SYS_SHUTDOWN = "persist.sys.shutdown";
    public static final String SYS_NEED_CHECK = "sys.need.check";
    public static final String FT_AGING_MUTE = "ft.aging.mute";

    public static final String LTE_MODEL_PATH = "/dev/ttyUSB0";

    //memory result
    public static final int EXIT_OK = 0x00;
    public static final int EXIT_FAIL_NONSTARTER = 0x01;
    public static final int EXIT_FAIL_ADDRESSLINES = 0x02;
    public static final int EXIT_FAIL_OTHERTEST = 0x04;

    //version info
    //触摸屏固件版本
    public static final String CAP_FW_VERSION = "/proc/ratta/cap_fw_version";
    //电磁屏固件版本
    public static final String EMR_FW_VERSION = "/proc/ratta/emr_fw_version";
    //墨水屏固件版本
    public static final String PV_EINK_WF_CODE = "pv.ro.eink.wfcode";
    //墨水屏批次

    //Vcom电压
    public static final String PV_EINK_VCOM = "pv.ro.eink.vcom";
    //驱动版本
    public static final String DRIVER_VERSION = "/proc/ratta/version";

    //abc log
    public static final String PERSIST_SYS_ABC_SWITCH = "persist.sys.abc_switch";
    //status bar flag
    public static final String PERSIST_EINK_BAR_FLAG = "persist.eink.bar.flag";

    public static final String PERSIST_MODEM_IN_TEST = "sys.modem.in_test";

    public static final String[] NUMBER = new String[]{"1.5", "2.0", "2.5", "3.0"};

    public static final String OEM_COPY = "/oem/copy/";
    public static final String EXTERNAL_STORAGE = Environment.getExternalStorageDirectory().getPath() + File.separator;

    //superNote add Key
    public static final int KEYCODE_DRAG = 290;
    public static final int KEYCODE_REFRESH = 291;
    public static final int KEYCODE_SLIDE = 292;

    //FLAG_KEY
    public final static int FLAG_KEY_POWER = 0x01;
    public final static int FLAG_KEY_HOME = 0x02;
    public final static int FLAG_KEY_HALL = 0x04;
    public final static int FLAG_KEY_BACK = 0x08;
    public final static int FLAG_KEY_VOLUME_UP = 0x10;
    public final static int FLAG_KEY_VOLUME_DOWN = 0x20;
    public final static int FLAG_KEY_DRAG = 0x40;
    public final static int FLAG_KEY_REFRESH = 0x80;
    public final static int FLAG_KEY_SLIDE = 0x100;
    public final static int FLAG_KEY_PAGE_UP = 0x200;
    public final static int FLAG_KEY_PAGE_DOWN = 0x400;
    public final static int FLAG_KEY_SEARCH = 0x800;
    public final static int FLAG_KEY_F2 = 0x1000;

    public final static int FLAG_KEY_TEST = Constants.FLAG_KEY_POWER | Constants.FLAG_KEY_HOME | Constants.FLAG_KEY_HALL
            | Constants.FLAG_KEY_BACK | Constants.FLAG_KEY_VOLUME_UP | Constants.FLAG_KEY_VOLUME_DOWN
            | Constants.FLAG_KEY_DRAG | Constants.FLAG_KEY_REFRESH | Constants.FLAG_KEY_SLIDE
            | Constants.FLAG_KEY_PAGE_UP | Constants.FLAG_KEY_PAGE_DOWN | Constants.FLAG_KEY_SEARCH | Constants.FLAG_KEY_F2;

}
